package com.ruoyi.shopping.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.shopping.domain.BbsLike;
import com.ruoyi.shopping.mapper.BbsLikeMapper;
import com.ruoyi.shopping.service.IBbsLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 论坛点赞Service业务层处理
 *
 * @author ruoyi
 * @date 2022-06-20
 */
@Service
public class BbsLikeServiceImpl implements IBbsLikeService
{
    @Autowired
    private BbsLikeMapper bbsLikeMapper;

    /**
     * 查询论坛点赞
     *
     * @param id 论坛点赞主键
     * @return 论坛点赞
     */
    @Override
    public BbsLike selectBbsLikeById(Long id)
    {
        return bbsLikeMapper.selectBbsLikeById(id);
    }

    /**
     * 查询论坛点赞列表
     *
     * @param bbsLike 论坛点赞
     * @return 论坛点赞
     */
    @Override
    public List<BbsLike> selectBbsLikeList(BbsLike bbsLike)
    {
        return bbsLikeMapper.selectBbsLikeList(bbsLike);
    }

    /**
     * 新增论坛点赞
     *
     * @param bbsLike 论坛点赞
     * @return 结果
     */
    @Override
    public int insertBbsLike(BbsLike bbsLike)
    {
        bbsLike.setCreateTime(DateUtils.getNowDate());
        return bbsLikeMapper.insertBbsLike(bbsLike);
    }

    /**
     * 修改论坛点赞
     *
     * @param bbsLike 论坛点赞
     * @return 结果
     */
    @Override
    public int updateBbsLike(BbsLike bbsLike)
    {
        bbsLike.setUpdateTime(DateUtils.getNowDate());
        return bbsLikeMapper.updateBbsLike(bbsLike);
    }

    /**
     * 批量删除论坛点赞
     *
     * @param ids 需要删除的论坛点赞主键
     * @return 结果
     */
    @Override
    public int deleteBbsLikeByIds(Long[] ids)
    {
        return bbsLikeMapper.deleteBbsLikeByIds(ids);
    }


    /**
     * 批量逻辑删除论坛点赞
     *
     * @param ids 需要删除的论坛点赞主键
     * @return 结果
     */
    @Override
    public int logicDeleteBbsLike(Long[] ids,String delType,Long delUser)
    {
        return bbsLikeMapper.logicDeleteBbsLike(ids,delType,delUser);
    }

    /**
     * 删除论坛点赞信息
     *
     * @param id 论坛点赞主键
     * @return 结果
     */
    @Override
    public int deleteBbsLikeById(Long id)
    {
        return bbsLikeMapper.deleteBbsLikeById(id);
    }

    @Override
    public Integer selectCount(BbsLike bbsLike) {
        return bbsLikeMapper.selectCount(bbsLike);
    }
}
